package ministock;

import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentMap;

import com.google.code.ministock.Stock;

public abstract class Agent implements Runnable {
	
	protected ConcurrentMap<String, List<Subscription>> subscriptionsMap;

	protected BlockingQueue<Stock> stocks;

	protected volatile boolean stopped;

	public Agent(ConcurrentMap<String, List<Subscription>> subscriptionsMap,
			BlockingQueue<Stock> stocks, boolean stopped) {
		super();
		this.subscriptionsMap = subscriptionsMap;
		this.stocks = stocks;
		this.stopped = stopped;
	}
	
	public List<Subscription> getSubscriptions(String stockName) {
		return MiniStock.getSubscriptions(subscriptionsMap, stockName);
	}
}
